<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%@ page isELIgnored="false"%>
<%@ include file="../common/taglibs.jsp"%>
<%
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
%>
<!doctype html>
<html lang="zh-CN">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="renderer" content="webkit">
    <title>商终明细信息</title>
    <link rel="icon" href="favicon.ico" type="image/x-icon"/>
    <!-- 当前页面样式 -->
    <link rel="stylesheet" href="<s:url value="/css/common.css"/>"/>
    <!-- 当前页面样式 END -->
    <script type="text/javascript" src="<c:url value="/js/jquery-1.3.2.js" />"></script>
	<script type="text/javascript" src="<c:url value="/js/common.js" />"></script>
	<script type="text/javascript" src="<c:url value="/js/My97DatePicker/WdatePicker.js"/>"></script>
	<script type='text/javascript' src='<s:url value="/js/pageAjax.js"/>'></script>
	<script type='text/javascript' src='<s:url value="/dwr/engine.js"/>'></script>
	<script type='text/javascript' src='<s:url value="/dwr/interface/MccQuery.js"/>'></script>
	<script type='text/javascript' src='<s:url value="/js/querySon.js"/>'></script>
	<script type="text/javascript">
	$(document).ready(function(){
		
		$('#sub').click(function(){
		 /* if(!checkDate()){
	           return false;
	         } */
		 $("#sub").attr("disabled", true);
			$("#queryUserForm").attr("action","<%=basePath%>/merTerm/queryMerinfoTermList.ct");
			$("#queryUserForm").submit();
		});
		
		$('#szPower').click(function(){
			/*  if(!checkDate()){
		           return false;
		         } */
			 $("#szPower").attr("disabled", true);
			$("#queryUserForm").attr("action","<%=basePath%>/merTerm/exportMerinfoTermDetail.ct");
			$("#queryUserForm").submit();
		});
	});	

	function   str2date(str){
		var d=null;   
		var reg=/^(\d{4})(\d{2})(\d{2})$/  ;
			if(arr=str.match(reg))d=new   Date(Number(arr[1]),Number(arr[2])-1,Number(arr[3])) ; 
		return   d;   
	}  

	function  checkDate(){
		var endTime = $("#crtMaxDate").val();
		var beginTime = $("#crtMinDate").val();
		
		if(!endTime || !beginTime){
			alert("创建时间范围必须选择!");
			return false;
		} 
		var date1=str2date(beginTime);
		var date2=str2date(endTime);

	    var dates = Math.abs((date1 - date2))/(1000*60*60*24);   
	    if(dates > 9){
		    alert("选择的创建时间相隔不能超过10天！");
			return false;
	    }
		return true;
	}

	
</script>
</head>
<body>
<s:form id="queryUserForm" action="/merTerm/queryMerinfoTermList.ct" method="post" theme="simple">
<s:hidden id="userId" value="%{#session.session_merchant.id}"/>
<table class="tb">
    <tbody>
        <tr class="tb-line">
            <td class="tb-td" colspan="4"><div class="tb-h2">POS收单运营管理平台</div></td>
        </tr>

        <tr class="tb-line">
            <td class="tb-td" colspan="4"><div class="tb-h3">商终明细信息</div></td>
        </tr>
 
       <tr class="tb-line">
            <td align="right" class="tb-td">
                <div class="tb-h4">商户号：</div>
            </td>
            <td class="tb-td">
                <label class="tb-input-normal">
                	<s:textfield  name="searchCondition.merchantNo" />
               	</label>
            </td>
             <td align="right" class="tb-td">
                <div class="tb-h4">商户简称：</div>
            </td>
            <td class="tb-td">
                <label class="tb-input-normal">
                	<s:textfield  name="searchCondition.merchantName" maxlength="20"/>
                </label>
            </td>
        </tr>

        <tr class="tb-line">
            <td align="right" class="tb-td">
                <div class="tb-h4">营业名称：</div>
            </td>
            <td class="tb-td">
                <label class="tb-input-normal">
                	<s:textfield  name="searchCondition.merBrName" maxlength="25"/>
                </label>
            </td>
            <td align="right" class="tb-td">入网时间：</td>
			<td class="tb-td" >
				 <label class="tb-input-normal">
					<s:textfield    onfocus="WdatePicker({dateFmt:'yyyy-MM-dd',readOnly:true,wdate:true,errDealMode:0});"    name="searchCondition.minDate"  />
				 </label>
				-
				 <label class="tb-input-normal">
					<s:textfield  onfocus="WdatePicker({dateFmt:'yyyy-MM-dd',readOnly:true,wdate:true,errDealMode:0});"   name="searchCondition.maxDate"   />
				</label>
			</td>
        </tr>
		<tr class="tb-line">
            <td align="right" class="tb-td">
                <div class="tb-h4">法人名称：</div>
            </td>
            <td class="tb-td">
                <label class="tb-input-normal">
                	<s:textfield  name="searchCondition.certifName" maxlength="25"/>
               	</label>
            </td>
             <td align="right" class="tb-td">
                <div class="tb-h4">法人身份证：</div>
            </td>
            <td class="tb-td">
                <label class="tb-input-normal">
                	<s:textfield  name="searchCondition.cardNo" maxlength="20"/>
                </label>
            </td>
        </tr>
        <tr class="tb-line">
            <td align="right" class="tb-td">
                <div class="tb-h4">业务联系人名称：</div>
            </td>
            <td class="tb-td">
                <label class="tb-input-normal">
                	<s:textfield  name="searchCondition.contactName" maxlength="25"/>
               	</label>
            </td>
             <td align="right" class="tb-td">
                <div class="tb-h4">业务联系人手机号：</div>
            </td>
            <td class="tb-td">
                <label class="tb-input-normal">
                	<s:textfield  name="searchCondition.phone" maxlength="15" />
                </label>
            </td>
        </tr>
        <tr class="tb-line">
            <td align="right" class="tb-td">
                <div class="tb-h4">结算账号：</div>
            </td>
            <td class="tb-td">
                <label class="tb-input-normal">
                	<s:textfield  name="searchCondition.accountNo" maxlength="25"/>
               	</label>
            </td>
             <td align="right" class="tb-td">
                <div class="tb-h4">结算账户姓名：</div>
            </td>
            <td class="tb-td">
                <label class="tb-input-normal">
                	<s:textfield  name="searchCondition.accountName" maxlength="20" />
                </label>
            </td>
        </tr>
        <tr class="tb-line">
            <td align="right" class="tb-td">
                <div class="tb-h4">非法人身份证：</div>
            </td>
            <td class="tb-td">
                <label class="tb-input-normal">
                	<s:textfield  name="searchCondition.clearCardId" maxlength="25"/>
               	</label>
            </td>
             <td align="right" class="tb-td">
                <div class="tb-h4">商户直属代理商：</div>
            </td>
            <td class="tb-td">
                <label class="tb-input-normal">
                	<s:textfield  name="searchCondition.directlyAgent" maxlength="20" />
                </label>
            </td>
        </tr>
        <tr class="tb-line">
			<td align="right" class="tb-td">
				<div class="tb-h4">营业执照号：</div>
			</td>	
			<td class="tb-td">
				<label class="tb-input-normal">
					<s:textfield  name="searchCondition.busiLiceNo" maxlength="20" />
				</label>
			</td>
	            <td width="12%" style="min-width: 150px" align="right" class="tb-td">
	                <div class="tb-h4">创建日期：</div></td>
	            <td class="tb-td">
	                <label class="tb-input-mini">
	                	<s:textfield id="crtMinDate" name="searchCondition.crtMinDate" onFocus="WdatePicker({dateFmt:'yyyyMMdd',readOnly:true,wdate:true,errDealMode:0});"
							theme="simple" cssClass="queryWidth" /> 
					</label>至：
					<label class="tb-input-mini">
						<s:textfield id="crtMaxDate" name="searchCondition.crtMaxDate" onFocus="WdatePicker({dateFmt:'yyyyMMdd',readOnly:true,wdate:true,errDealMode:0});"
							theme="simple" cssClass="queryWidth" />
					</label>
					<code class="asterisk">*</code>
				</td>	
			</tr>
		<tr class="tb-line">
            <td align="right" class="tb-td">
                <div class="tb-h4">商户状态：</div>
            </td>
            <td class="tb-td">
                <label class="tb-input-mini">
                	<s:select list="#{'99':'请选择状态','01':'正常','03':'冻结','02':'注销' }" name="searchCondition.status" />
               	</label>
            </td>
            <td align="right" class="tb-td">
                <div class="tb-h4">商户连接方式：</div>
            </td>
           <td class="tb-td" >
		       <s:select  name="searchCondition.association" list="#{'2':'间连直营'}"  headerKey="99" headerValue="--请选择--" cssClass="queryWidth" /> 
      	   </td>
          </tr>
		
        <tr class="tb-line">
            <td class="tb-td line-submit" align="right" colspan="4">
                <label class="tb-input-submit">
                   <input type="button" value="查询" id="sub"/>
                </label>
                <label class="tb-input-submit">
                    <input type="reset" value="取消"/>
                </label>
                <label class="tb-input-submit">
                	<s:if  test="#request.searchRsList != null && #request.searchRsList.size>0">
						<input id="szPower" type="button" value="导出Excel" />
					</s:if>
					<s:else>
					 	<input id="szPower" disabled="disabled" value="导出Excel" type="button" />
					</s:else>
                </label> 
                
             
            </td>
        </tr>
         <tr class="tb-line">
         		<td class="tb-td line-submit" align="center" colspan="4">
         			<font color="red" id="msgInfo"><s:actionmessage/>
         				<s:if test="#request.COUNT != null">
		               	统计：当前查询条件共计[<font color="red"><s:property value="#request.COUNT"/></font>]条数据
		               	</s:if>
         			</font>
         		</td>
         </tr>
        <s:if test="#request.searchRsList != null && #request.searchRsList.size>0 ">
			<tr class="tb-line">
				<td class="tb-td paging"  align="left" colspan="4"> 
					 	<page:pageCount max_pages="11" totalPage="${requestScope.totalPage}"
						currentPage="${requestScope.currentPage}"
						action="${rootPath}/merTerm/queryMerinfoTermList.ct?currentPage=" />

				</td>
			</tr>
		</s:if>
    </tbody>
</table>
</s:form>
<div class="big-tb">
    <table class="tb" style="width: 150%;">
        <thead>
            <tr class="tb-line">
                <th class="tb-th" colspan="24">商户终端信息列表</th>
            </tr>
            <tr class="tb-line bg-gray">
				<th class="tb-th">商户号</th>
				<th class="tb-th">终端号</th>
				<th class="tb-th">终端状态</th>
				<th class="tb-th">商户注册名称</th>
				<th class="tb-th">商户简称</th>
				<th class="tb-th">结算周期</th>
				<th class="tb-th">商户营业执照号</th>
				<th class="tb-th">商户注册地址</th>
				<th class="tb-th">装机地址</th>
				<th class="tb-th">法人代表</th>
				<th class="tb-th">商户入网时间</th>
				<th class="tb-th">商户状态</th>
				<th class="tb-th">优惠标准</th>
				<th class="tb-th">直属代理商</th>
				<th class="tb-th">所属分公司</th>
				<th class="tb-th">所属大区</th>
				<th class="tb-th">商户联系人</th>
				<th class="tb-th">商户联系手机</th>
				<th class="tb-th">MCC编号</th>
				<th class="tb-th">MCC大类</th>
				<th class="tb-th">省份</th>
				<th class="tb-th">城市</th>
				<th class="tb-th">发展人</th>
				<th class="tb-th">机具产权</th>
				<th class="tb-th">终端类型</th>
				<th class="tb-th">终端SN号</th>
				<th class="tb-th">申请人</th>
				<th class="tb-th">主营业务</th>
				<th class="tb-th">终端进件时间</th>
				<th class="tb-th">终端关闭时间</th>
				<th class="tb-th">T1借记卡费率(%)</th>
				<th class="tb-th">T1借记卡封顶值(元)</th>
				<th class="tb-th">T1贷记卡费率(%)</th>
				<th class="tb-th">T1贷记卡封顶值(元)</th>
				<th class="tb-th">支付宝/微信扫码费率(%)</th>
				<th class="tb-th">银联扫码费率(%)</th>
				<th class="tb-th">DO状态</th>
				<th class="tb-th">D0借记卡费率(%)</th>
				<th class="tb-th">D0贷记卡费率(%)</th>
				<th class="tb-th">账户性质</th>
				<th class="tb-th">入账名称</th>
				<th class="tb-th">结算帐号</th>
				<th class="tb-th">开户行	</th>
<!-- 				<th class="tb-th">开户支行</th> -->
				<th class="tb-th">特殊计费标志</th>
				<th class="tb-th">是否支持预授权</th>
				 <!-- <th class="tb-th">单笔借记卡限额</th>
				<th class="tb-th">单笔贷记卡限额</th>
				<th class="tb-th">单笔扫码限额</th>  -->
            </tr>
        </thead>
        <tbody>
			<s:iterator value="#request.cclist" status="stat" id="sh">
				<tr class="tb-line" >
			        <td class="tb-td"><s:property value="#sh.mchtCd"/></td>
			        <td class="tb-td"><s:property value="#sh.termid"/></td>
			        <td class="tb-td"><s:property value="#sh.termStatus"/></td>
					<td class="tb-td"><s:property value="#sh.name"/></td>
					<td class="tb-td"><s:property value="#sh.nameBusi"/></td>
					<td class="tb-td"><s:property value="#sh.accPeri"/></td>
					<td class="tb-td"><s:property value="#sh.BusiLicnNo"/></td>
					<td class="tb-td"><s:property value="#sh.regAddr"/></td>
					<td class="tb-td"><s:property value="#sh.installlocation"/></td>
					<td class="tb-td"><s:property value="#sh.certif"/></td>
					<td class="tb-td"><s:property value="#sh.apprDate"/></td>
					<td class="tb-td"><s:property value="#sh.status"/></td>
					<td class="tb-td"><s:property value="#sh.discNorm"/></td>
					<td class="tb-td"><s:property value="#sh.filialeName"/></td>
					<td class="tb-td"><s:property value="#sh.coopOrg"/></td>
					<td class="tb-td"><s:property value="#sh.region"/></td>
					<td class="tb-td"><s:property value="#sh.contactName"/></td>
					<td class="tb-td"><s:property value="#sh.contactPhoneno"/></td>
					<td class="tb-td"><s:property value="#sh.mccCd18"/></td>
					<td class="tb-td"><s:property value="#sh.mchtType"/></td>
					<td class="tb-td"><s:property value="#sh.prov"/></td>
					<td class="tb-td"><s:property value="#sh.city"/></td>
					<td class="tb-td"><s:property value="#sh.ext1"/></td>
					<td class="tb-td"><s:property value="#sh.termAut"/></td>
					<td class="tb-td"><s:property value="#sh.TermTp"/></td>
					<td class="tb-td"><s:property value="#sh.DeviceCd"/></td>
					<td class="tb-td"><s:property value="#sh.proposer"/></td>
					<td class="tb-td"><s:property value="#sh.busi_main"/></td>
					<td class="tb-td"><s:property value="#sh.REC_CRT_TS"/></td>
					<td class="tb-td"><s:property value="#sh.termShutDate"/></td>
					<td class="tb-td"><s:property value="#sh.T1_J"/></td>
					<td class="tb-td"><s:property value="#sh.T1_JF"/></td>
					<td class="tb-td"><s:property value="#sh.T1_D"/></td>	
					<td class="tb-td"><s:property value="#sh.T1_DF"/></td>
					<td class="tb-td"><s:property value="#sh.ZFB_S"/></td>
					<td class="tb-td"><s:property value="#sh.YL_S"/></td>
					<td class="tb-td"><s:property value="#sh.D0Status"/></td>
					<td class="tb-td"><s:property value="#sh.D0_J"/></td>
					<td class="tb-td"><s:property value="#sh.D0_D"/></td>
					
					<td class="tb-td">
					<s:if test="#sh.approvalusername==\"0\"">对私账户</s:if>
					<s:if test="#sh.approvalusername==\"1\"">对公账户</s:if>
					
					</td>
					
					<td class="tb-td"><s:property value="#sh.backName"/></td>
					<td class="tb-td"><s:property value="#sh.account"/></td>
					<td class="tb-td"><s:property value="#sh.bankNa"/></td>
<%-- 					<td class="tb-td"><s:property value="#sh.bankName"/></td> --%>
					<td class="tb-td"><s:property value="#sh.extraRate"/></td>
					<td class="tb-td"><s:property value="#sh.isYsq"/></td>
					<%-- <td class="tb-td"><s:property value="#sh.DJmax"/></td>
					<td class="tb-td"><s:property value="#sh.DDmax"/></td>
					<td class="tb-td"><s:property value="#sh.DSmax"/></td> --%>
						        
			      </tr>
			</s:iterator>		
        </tbody>
    </table>
   
</div>
 <s:if test="#request.msg !=null">
		<script language="javascript">
			alert("${request.msg}");
		</script>
	</s:if>
</body>
</html>